package com.foreknow.demo3;

import java.util.Scanner;

public class PayrollSystem {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("请输入月份");
        int month  = input.nextInt();
        //创建Employee的数组
        Employee[] employees = new Employee[2];
        employees[0] = new SalariedEmployee("fender",1,new MyDate(2022,6,17),9999);
        employees[1] = new HourlyEmployee("gibson",2,new MyDate(2022,5,17),66,300);

        for(int i = 0;i<employees.length;i++) {
            System.out.println(employees[i].toString());
            double salary = employees[i].earnings();
            if(month==employees[i].getBirthday().getMonth()) {
                double addMoney = employees[i].earnings()+666;
                System.out.println(""+addMoney);
            }
        }
    }
}
